Field of the Invention
The present invention relates to an image processing method in which a model edge image that is generated based on a detection target object used for pattern matching is used as a final model edge image. Further, the present invention also relates to an image processing device and a robot system.
Description of the Related Art
Conventionally, in a field of image processing, a pattern matching method has been known as a method for detecting a position and an orientation of a detection target object such as a work. In particular, a method known as shape pattern matching (hereinafter, referred to as “pattern matching”) has been widely employed because the method has high robustness in terms of variations in illumination and an object with a hidden or void portion.
In the pattern matching, because a similarity is calculated by using shape characteristics of a model (i.e., reference image) and a search image of a detection target object, it is necessary to extract the shape characteristics of the detection target object from the images. Generally, an edge extraction method such as the Sobel filter or the Canny filter is known as the method for extracting the shape characteristics. Therefore, there has been known a calculation method in which the above-described edge extraction method is applied to a model and a search image to generate a model edge image and a search edge image to calculate the similarity between the model edge image and the search edge image.
However, in practice, because of influence of the noise such as dust or dirt adhering thereto, variations in illumination, or individual variability, the detection target object may have a surface condition different from the ideal surface condition. Therefore, a position and an edge direction may be different at an edge point of the detection target object in the search image and an edge point of the model. In particular, because the similarity is lowered when the position and the edge direction are significantly different at the edge point of the detection target object in the search image and the edge point of the model, the detection target object may be mistakenly determined to have low similarity. Therefore, there arises a problem in that detection accuracy of the detection target object is lowered.
Japanese Patent Application Laid-Open No. 2010-97438 discusses a method for generating a model edge image based on a model. In the method, a long edge that is deemed less influenced by the noise is kept while a short edge that can be considerably influenced by the noise is eliminated in generating a model edge image. According to the above-described generation method of the model edge image, the similarity can be prevented from being lowered and the detection accuracy of the detection target object can be improved in comparison to the case where the similarity is determined by using a model edge image that is generated without using the above-described generation method.
However, according to the generation method of the model edge image described in Japanese Patent Application Laid-Open No. 2010-97438, determination on whether to eliminate the edge point is simply made based on a length of the edge. Therefore, for example, in a case where an edge has a short length, the edge is eliminated even if the edge is not influenced by the noise, so that the similarity is lowered. Therefore, there is a problem in that detection accuracy of the detection target object is lowered. On the other hand, in a case where an edge has a long length, the edge is not eliminated even if the edge is influenced by the noise, so that the similarity thereof is lowered. Therefore, there is a problem in that detection accuracy of the detection target object is lowered.